<template>
  <div class="app-container">
    <!-- Header 区域 -->
    <CartHeader></CartHeader>

    <!-- 商品 Item 项组件 -->
    <CartItem :item="item" v-for="item in list" :key="item.id"></CartItem>

    <!-- Foote 区域 -->
    <CartFooter></CartFooter>
  </div>
</template>
<script>
import CartHeader from './components/cart-header.vue'
import CartFooter from './components/cart-footer.vue'
import CartItem from './components/cart-item.vue'
import { mapState } from 'vuex'
export default {
  name: 'app',
  components: {
    CartHeader,
    CartFooter,
    CartItem
  },
  data () {
    return {

    }
  },
  created () {
    this.$store.dispatch('cart/GetList')
  },
  computed: {
    ...mapState('cart', ['list'])
  },
  methods: {
  }
}
</script>
<style lang='less'  scoped>
</style>
